﻿using IdentityServer4;
using IdentityServer4.Models;
using IdentityServer4.Test;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Ids4Review.AuthorizationServer
{
    public class Config
    {
        public static IEnumerable<ApiResource> GetApiResources()
        {
            return new List<ApiResource>() {
                new ApiResource("test_api","test_api")
            };
        }
        public static IEnumerable<Client> GetClients()
        {
            return new List<Client>()
            {
                new Client(){
                     AllowedGrantTypes={ GrantType.Implicit},
                     AllowedScopes={ IdentityServerConstants.StandardScopes.Profile,IdentityServerConstants.StandardScopes.OpenId,IdentityServerConstants.StandardScopes.Email},
                     ClientId="mvc",
                     ClientSecrets={ new Secret("p@ssw0rd".Sha256())},
                     RequireConsent=true,
                     RedirectUris={ "http://localhost:5001/signin-oidc"},
                     PostLogoutRedirectUris={ "http://localhost:5001/signout-callback-oidc"},

                     //AlwaysIncludeUserClaimsInIdToken=true,
                     ClientName="凤凰新华垂直主站",
                     ClientUri="http://localhost:5000",
                     AllowRememberConsent=true,
                     LogoUri="https://docs.microsoft.com/zh-cn/azure/media/index/logo_net.svg"
                     //LogoUri="/images/erfen_fenghuang_logo.png"

                }
            };
        }
        public static List<TestUser> GetUsers()
        {
            return new List<TestUser>() {
                new TestUser(){
                    SubjectId ="1",
                    Username ="Zj",
                 Password="p@ssw0rd"
                }
            };
        }
        public static IEnumerable<IdentityResource> GetIdentityResources()
        {
            return new List<IdentityResource>() {
                new IdentityResources.Profile(),
                new IdentityResources.OpenId(),
               new IdentityResources.Email(),
            };
        }
    }
}
